package com.jeethink.erp.saleDetail.service.impl;

import java.util.List;
import com.jeethink.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.jeethink.erp.saleDetail.mapper.TbSaleDetailMapper;
import com.jeethink.erp.saleDetail.domain.TbSaleDetail;
import com.jeethink.erp.saleDetail.service.ITbSaleDetailService;

/**
 * 销售明细Service业务层处理
 * 
 * @author ypr
 * @date 2021-06-07
 */
@Service
public class TbSaleDetailServiceImpl implements ITbSaleDetailService 
{
    @Autowired
    private TbSaleDetailMapper tbSaleDetailMapper;

    /**
     * 查询销售明细
     * 
     * @param id 销售明细ID
     * @return 销售明细
     */
    @Override
    public TbSaleDetail selectTbSaleDetailById(Long id)
    {
        return tbSaleDetailMapper.selectTbSaleDetailById(id);
    }

    /**
     * 查询销售明细列表
     * 
     * @param tbSaleDetail 销售明细
     * @return 销售明细
     */
    @Override
    public List<TbSaleDetail> selectTbSaleDetailList(TbSaleDetail tbSaleDetail)
    {
        return tbSaleDetailMapper.selectTbSaleDetailList(tbSaleDetail);
    }

    /**
     * 新增销售明细
     * 
     * @param tbSaleDetail 销售明细
     * @return 结果
     */
    @Override
    public int insertTbSaleDetail(TbSaleDetail tbSaleDetail)
    {
        tbSaleDetail.setCreateTime(DateUtils.getNowDate());
        return tbSaleDetailMapper.insertTbSaleDetail(tbSaleDetail);
    }

    /**
     * 修改销售明细
     * 
     * @param tbSaleDetail 销售明细
     * @return 结果
     */
    @Override
    public int updateTbSaleDetail(TbSaleDetail tbSaleDetail)
    {
        tbSaleDetail.setUpdateTime(DateUtils.getNowDate());
        return tbSaleDetailMapper.updateTbSaleDetail(tbSaleDetail);
    }

    /**
     * 批量删除销售明细
     * 
     * @param ids 需要删除的销售明细ID
     * @return 结果
     */
    @Override
    public int deleteTbSaleDetailByIds(Long[] ids)
    {
        return tbSaleDetailMapper.deleteTbSaleDetailByIds(ids);
    }

    /**
     * 删除销售明细信息
     * 
     * @param id 销售明细ID
     * @return 结果
     */
    @Override
    public int deleteTbSaleDetailById(Long id)
    {
        return tbSaleDetailMapper.deleteTbSaleDetailById(id);
    }
}
